package com.systop.busafter.admin.mapper;

import com.systop.commer.pojo.Admin;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface AdminMapper {
    /*
     * 修改admin
     * Admin admin
     * return int
     * csh
     * */
    @Update("update admin set admin_name_n = #{admin_name_n},admin_password = #{admin_password},admin_remarks = #{admin_remarks} where admin_id = #{admin_id}")
    int updataadmin(Admin admin);


    //"time = #{time,jdbcType=TIMESTAMP} "  时间类型

    /*
     * 添加admin
     * admin admin
     * return int
     * csh
     * */
    @Insert("insert into admin(admin_name_n,admin_password,admin_remarks) values (#{admin_name_n},#{admin_password},#{admin_remarks})")
    int insertAdmin(Admin admin);

    /*
     * 账号密码登陆
     * admin admin
     * admin admin
     * csh
     * */
    @Select("select * from admin where admin_name_n = #{admin_name_n} and admin_password= #{admin_password}")
    Admin adminLogin(Admin admin);

    /*
     * 查看全部
     * 无
     * list
     * csh
     * */
    @Select("select * from admin")
    List<Admin> adminListall();

    /*
     * 用id查看admin
     * admin_id  int
     * list
     * csh
     * */
    @Select("select * from admin where admin_id = #{admin_id}")
    List<Admin> adminIdlist(int admin_id);

    /*
     * 删除admin
     * admin_id  int
     * return int
     * csh
     * */
    @Delete("delete from admin where admin_id=#{admin_id}")
    int deleteAdmin(int admin_id);

}
